/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.MainCauseDao;
import com.rbh.risk.entity.MainCause;
import com.rbh.risk.service.MainCauseService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("mainCauseService")
public class MainCauseServiceImpl implements MainCauseService {
    
    @Autowired
    private MainCauseDao mainCauseDao;
    
    @Transactional(readOnly = false)
    @Override
    public void insert(MainCause mainCause) {
        this.mainCauseDao.insert(mainCause);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(MainCause mainCause) {
        this.mainCauseDao.update(mainCause);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(MainCause mainCause) {
        this.mainCauseDao.delete(mainCause);
    }

    @Transactional(readOnly = true)
    @Override
    public MainCause getById(Integer mainCauseId) {
        return this.mainCauseDao.getById(mainCauseId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<MainCause> getAll() {
        return this.mainCauseDao.getAll();
    }
}
